package com.rdzn.mall.center.enums;

public enum OrderStatus {

    WAIT_PAY(0, "待付款"),
    WAIT_SEND(1, "待发货"),
    SENDED(2, "已发货"),
    FINISH(3, "已完成"),
    CLOSED(4, "已关闭"),
    INVALID(5, "无效订单");

    public Integer CODE;

    public String VALUE;

     OrderStatus(Integer code, String value){
        this.CODE = code;
        this.VALUE = value;
    }

    public static OrderStatus get(Integer code){
         switch (code){
             case 0:
                 return WAIT_PAY;
             case 1:
                 return WAIT_SEND;
             case 2:
                 return SENDED;
             case 3:
                 return FINISH;
             case 4:
                 return CLOSED;
             default:
                 return INVALID;
         }
    }
}
